package com.brillilab.message.core.enums;

import com.brillilab.common.constant.ResultEnum;
import com.brillilab.common.exceptions.BrillilabException;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum  SocketEndPointEnum {

    AIO(1,"aio"),WEB(2,"web"),PC(2,"pc"),BENCH(2,"bench");
    private Integer value;
    private String name;

    public static Integer getValue(String name){
        SocketEndPointEnum[] enums=SocketEndPointEnum.values();
        for (SocketEndPointEnum endPointEnum:enums){
            if(endPointEnum.name.equals(name)){
                return endPointEnum.value;
            }
        }
        throw new BrillilabException(ResultEnum.DATA_NOT_EXIST);
    }
}
